public class simulate {
    public String modifyString(String s) {
        int len = s.length();
        char[] arr = s.toCharArray();
        for (int i = 0; i < len; i++) {
            if (arr[i] == '?') {
                for (char ch = 'a'; ch <= 'z'; ch++) {
                    if ((i == 0 || arr[i - 1] != ch) && (i == len - 1 || arr[i + 1] != ch)) {
                        arr[i] = ch;
                        break;
                    }
                }
            }
        }
        return String.valueOf(arr);
    }
}
